﻿// HSS.Logging.DefaultFormatter.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.html
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       DefaultFormatter.cs
// Author:     HSS\gbanta
// Created:    08/12/2010
// Modified:   12/04/2010
// ----------------------------------------------------------------------------
namespace HSS.Logging
{
	#region Using Directives
	using System;
	#endregion

	#region DefaultFormatter
	/// <summary>
	/// The Default Log Formatter
	/// </summary>
	internal class DefaultFormatter : ILogEntryFormatter
	{
		#region ILogEntryFormatter Members
		/// <summary>
		/// Does not format the entry
		/// </summary>
		/// <param name="entry">The originatign entry</param>
		/// <param name="log">The source log instance</param>
		public void Format(LogEntry entry, ILog log)
		{
		}
		/// <summary>
		/// A call to this method allows for altering the given Log Entry prior to being written to the actual log
		/// </summary>
		/// <param name="ex">The exception to be processed</param>
		/// <param name="entry">The original entry prior to being written to the log</param>
		/// <param name="log">The source log instance</param>
		public void FormatException(Exception ex, LogEntry entry, ILog log)
		{
			if (string.IsNullOrEmpty(entry.Message) && null != ex)
				entry.Message = ex.ToString();
		}
		#endregion
	}
	#endregion
}